package com.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mapper.auto.SchoolLabelMapper;
import com.model.auto.SchoolLabel;
import com.service.ISchoolLabelService;
import com.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author astupidcoder
 * @since 2022-09-14
 */
@Service
public class SchoolLabelServiceImpl extends ServiceImpl<SchoolLabelMapper, SchoolLabel> implements ISchoolLabelService {
    @Autowired
    private SchoolLabelMapper schoolLabelMapper;

    @Override
    public List<SchoolLabel> getcollegeLevel(String Hierarchys) {
        return schoolLabelMapper.getcollegeLevel(Hierarchys);
    }

    @Override
    public List<SchoolLabel> getqualifications(String qualifications) {
        return schoolLabelMapper.getqualifications(qualifications);
    }

    @Override
    public SchoolLabel selectByCode(String code) {
        SchoolLabel schoolLabel = this.getOne(new LambdaQueryWrapper<SchoolLabel>()
                .eq(!StringUtil.isEmpty(code), SchoolLabel::getCode, code));
        return schoolLabel;
    }

    @Override
    public List<SchoolLabel> getByParam(String hierarchys, String qualifications) {
        return schoolLabelMapper.getByParam(hierarchys, qualifications);
    }
}
